package concept.misc;

public class OperatorLab
{
	static void doA()
	{
		int i = 1;
		int j = 2;
		
		float n = i++ * ++j /i;
		
		System.out.println(String.format("i=%d, j=%d, n=%f", i, j, n));
		
		System.out.println(String.format("%f", (double)(3/2)));
	}
	static void doB()
	{
		int x=0,y = 0;
		x--;
		y = x++ + ++x;
		System.out.printf("x=%d\n",x);
		System.out.printf("y=%d\n",y);
	}
	
	static void doDeviden()
	{
		Integer x = 9;
		int y = 5;
		System.out.println(x/=y);
	}
	
	static void doInstanceof()
	{
		String s = null;
		String ss = "s";
		System.out.printf("s(null String) instanceof String? %b\n", s instanceof String);
		System.out.printf("s(null String) instanceof Object? %b\n", s instanceof Object);
		System.out.printf("ss instanceof String? %b\n", ss instanceof String);
		System.out.printf("null instanceof String? %b\n", null instanceof String);
		System.out.printf("null instanceof Object? %b\n", null instanceof Object);
	}
	public static void main(String[] args)
	{
		doA();
		doB();
		doDeviden();
		doInstanceof();
	}

}
